#pragma once

#include <iostream>
#include "cocos2d.h"

using namespace std;
using namespace cocos2d;

class ShowCardNode : public Node
{
public:
	enum
	{
		HOURSE = 2,
		MONEY = 3
	};

	static ShowCardNode* create(int nType);

private:
	int m_nType;
	Sprite* m_pBase;

	bool init(int nType);
	void updateContent();
};

class SoundsNode : public Node
{
public:
	enum
	{
		SOUNDS = 0,
		MUSIC
	};

	static SoundsNode* create(unsigned int nType);

private:
	unsigned int m_nType;
	MenuItemImage* m_pSoundButton = nullptr;
	Vector<Sprite*> m_rgMarks;
	bool m_bIsMute = false;
	int m_nCurrentMarkIndex = 9;

	bool init(unsigned int nType);
	void onAddButtonClick();
	void onSubButtonClick();
	void onSoundButtonClick();

	static int s_nSoundIndex;
	static int s_nMusicIndex;
};

class SettingBoard : public Layer
{
public:
	CREATE_FUNC(SettingBoard);

private:
	virtual bool init() override;
	Sprite* m_pIconMark = nullptr;
	Sprite* m_pIconDescMark = nullptr;
	Sprite* m_pBoardBaseSprite = nullptr;
	Sprite* m_pIconDesc = nullptr;
	Label* m_pIconLabel = nullptr;

	void refreshLabel(int nIconIndex);
	void onCloseButtonClick();
	void onHelpButtonClick();
	void onIconClick(int nIconIndex);

	bool onTouchBegan(Touch *touch, Event *event) override;
};